Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create gyro E-CLP on v3 #570

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

feat: create gyro E-CLP on v3 #570

wants to merge 24 commits into from

Conversation

johngrantuk
Copy link
Member

@johngrantuk johngrantuk commented Jan 22, 2025

Closes #571

Summary

@johngrantuk johngrantuk marked this pull request as ready for review February 28, 2025 13:24
@MattPereira MattPereira changed the title V3 gyro eclp Create gyro E-CLP on v3 Mar 1, 2025
@MattPereira MattPereira mentioned this pull request Mar 4, 2025
@MattPereira MattPereira changed the title Create gyro E-CLP on v3 feat: create gyro E-CLP on v3 Mar 4, 2025
Comment on lines +326 to +338
// TODO: grow bigger brain to figure out param values that trigger InvariantDenominatorWrong
test.skip('InvariantDenominatorWrong()', async () => {
expect(
buildCallWithModifiedInput({
eclpParams: {
s: _ONE,
},
derivedEclpParams: {
u: _ONE_XP,
},
}),
).toThrowError(
`InvariantDenominatorWrong: mulDenominator must be <= ${_MAX_INV_INVARIANT_DENOMINATOR_XP}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone thinks this is worth figuring out, I can spend more time on it, but kinda tricky with the derived params being calculated off chain by closed source code

https://github.com/balancer/balancer-v3-monorepo/blob/56a0d28c39060f7b846a5b9413ec61210c03a540/pkg/interfaces/contracts/pool-gyro/IGyroECLPPool.sol#L115-L137

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also is it weird to have the validation tests in SDK repo but the logic in balancer maths?

Comment on lines +20 to +26
validateCreatePool(input: CreatePoolGyroECLPInput) {
super.validateCreatePool(input);

const { eclpParams, derivedEclpParams } = input;

GyroECLPMath.validateParams(eclpParams);
GyroECLPMath.validateDerivedParams(eclpParams, derivedEclpParams);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was such a satisfying refactor 😍

@MattPereira MattPereira requested a review from mkflow27 March 5, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

V3 GyroECLP Create
3 participants